const HtmlWebpackPlugin = require('html-webpack-plugin')
const { VueLoaderPlugin } = require('vue-loader')

module.exports = {
    entry: path.join(__dirname,'./src/main.js'),
    output: {
        path: path.join(__dirname,'./dist'),
        filename: '[name].[hash:6].js'
    },
    resolve: {
        extensions: ['.js', '.vue', '.json'],
        alias: {
            'assets':path.join(__dirname,'assets'),
            'pages': path.join(__dirname,'src/pages'),
            'public':path.join(__dirname,'public'),
            'components':path.join(__dirname,'src/components')
        }
    },
    module: {
        rules: [
            {
                test: /\.(js|vue)$/,
                use: 'eslint-loader',
                enforce: 'pre'
            }
        ]
    },

    plugins: [
        new HtmlWebpackPlugin({
            template: 'src/index.html',
        }),
        new VueLoaderPlugin()
    ]
}